package com.jalarbee.stock.product.business;

import com.jalarbee.core.money.MonetaryAmount;
import com.jalarbee.stock.store.business.Store;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import org.hibernate.annotations.Columns;
import org.hibernate.annotations.Type;

/**
 *
 * @author devel
 */
@Entity
public class StorePricing implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    
    @OneToOne(fetch=FetchType.LAZY)
    private Store store;
    
    @OneToOne(fetch=FetchType.LAZY)
    private Product product;

    @Type(type = "com.jalarbee.core.money.MonetaryAmountType")
    @Columns(columns = {
        @Column(name = "s_currency"),
        @Column(name = "s_amount")})
    private MonetaryAmount strockPrice;

    @Type(type = "com.jalarbee.core.money.MonetaryAmountType")
    @Columns(columns = {
        @Column(name = "r_currency"),
        @Column(name = "r_amount")})
    private MonetaryAmount retailPrice;

    @Type(type = "com.jalarbee.core.money.MonetaryAmountType")
    @Columns(columns = {
        @Column(name = "c_currency"),
        @Column(name = "c_amount")})
    private MonetaryAmount creditPrice;

    public MonetaryAmount getCreditPrice() {
        return creditPrice;
    }

    public void setCreditPrice(MonetaryAmount creditPrice) {
        this.creditPrice = creditPrice;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public MonetaryAmount getRetailPrice() {
        return retailPrice;
    }

    public void setRetailPrice(MonetaryAmount retailPrice) {
        this.retailPrice = retailPrice;
    }

    public Store getStore() {
        return store;
    }

    public void setStore(Store store) {
        this.store = store;
    }

    public MonetaryAmount getStrockPrice() {
        return strockPrice;
    }

    public void setStrockPrice(MonetaryAmount strockPrice) {
        this.strockPrice = strockPrice;
    }
}
